package com.example.ruralservicedigitalplatform.controller.villager;

import com.example.ruralservicedigitalplatform.comment.Result;
import com.example.ruralservicedigitalplatform.domain.po.Category;
import com.example.ruralservicedigitalplatform.service.CategoryService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController("villagerCategoryController")
@RequestMapping("/villager/category")
@Slf4j
@Tag(name = "商品分类相关接口")
public class CategoryController {
    @Autowired
    private CategoryService categoryService;
    @GetMapping("/list")
    @Operation(summary = "查询分类")
    public Result<List<Category>> list(){
        List<Category> list = categoryService.list();
        return Result.success(list);
    }
}
